#include <iostream>
#include <string>
#include <algorithm>


/**
 * 十进制转十六进制
 */
int main() {
    std::string result;

    int n;
    std::cin >> n;    

    while (n) {
        int digit = n % 16;
        if (digit < 10) {
            result += std::to_string(digit);
        }else {
            result += static_cast<char>('A' + digit - 10);
        }

        n /= 16;
    }

    std::reverse(result.begin(), result.end());

    std::cout << result << "\n";   

    return 0;
}
